<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>03_盒子模型-外边距-margin合并-垂直方向的外边距</title>
        <style>
            #outer {
                border: 5px solid black;
                padding: 10px;
            }

            .item {
                width: 400px;
                height: 80px;
                border: 2px dashed red;
            }

            /* 当2个相邻的元素 并且是垂直方向  那么2个外边距会取大值
             eg:20  50 ==>50  20  20==>
            */
            .item2 {
                margin-bottom: 20px;
            }

            .item3 {
                margin-top: 20px;
            }

        </style>
    </head>
    <body>
        <div id="outer">
            <div class="item">1</div>
            <div class="item item2">2</div>
            <div class="item item3">3</div>
            <div class="item">4</div>
        </div>
    </body>
</html>